//
//  GroupView.swift
//  RoundCatPlay2
//
//  Created by 姜澎 on 2019/10/29.
//  Copyright © 2019 jiangpeng. All rights reserved.
//

import UIKit

class GroupView: UIView {
    
    
    private lazy var groupView: UIView = {
        let v = UIView()
        v.backgroundColor = UIColor(red: 246/255, green: 247/255, blue: 250/255, alpha: 1)
        return v
    }()
    
    public lazy var jnImage: UIImageView = {
        let i = UIImageView()
        i.contentMode = .scaleAspectFit
        return i
    }()
    
    public lazy var jnL: UILabel = {
        let l = UILabel()
        
        l.font = UIFont.boldSystemFont(ofSize: 16)
        return l
    }()

    override init(frame: CGRect) {
        super.init(frame: frame)
        addSubview(self.groupView)
        addSubview(self.jnImage)
        addSubview(self.jnL)
        setJnImageFrame()
        setGroupViewFrame()
        setJNLableFrame()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setGroupViewFrame(){
        self.groupView.snp.makeConstraints { (make) in
            make.top.equalTo(0)
            make.left.equalTo(0)
            make.right.equalTo(0)
            make.height.equalTo(10)
        }
    }
    
    func setJnImageFrame() {
        self.jnImage.snp.makeConstraints { (make) in
            make.top.equalTo(self.groupView.snp.bottom).offset(20)
            make.left.equalTo(15)
            make.bottom.equalTo(-10)
            make.width.equalTo(17)
            make.height.equalTo(18)
        }
    }
    
    func setJNLableFrame() {
        self.jnL.snp.makeConstraints { (make) in
            make.top.equalTo(self.jnImage.snp_top)
            make.bottom.equalTo(self.jnImage.snp_bottom)
            make.left.equalTo(self.jnImage.snp_right).offset(10)
        }
    }
}
